home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
003
/
cforth
/
l2b.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
674b
|
29 lines
/* usage: line2block < linefile > blockfile
* takes a file (like one generated by block2line) of the form:
* <header line>
* < 16 screen lines >
* ...
* and produces a block file with exactly 64 characters on each line, having
* removed the header lines. This file is suitable for use with FORTH as a
* block file.
*/
#include <stdio.h>
main()
{
int i;
char buf[65];
char *spaces = /* 64 spaces, below */
" ";
/* 64 spaces, above */
while (1) {
gets(buf); /* header line */
for (i=0; i<16; i++) {
if (gets(buf) == NULL) exit(0);
printf("%s%s",buf,spaces+strlen(buf));
}
}
}